<template>
  <div class="outside">
    <div class="topbutton">
      <div class="button" :class="{active:isactive}" @click="changeActive">新歌速递</div>
      <div class="button" :class="{active:!isactive}" @click="changeActive">新碟上架</div>
    </div>
    <div class="tab">
      <span v-for="(item,i) in tabs" 
            :key="i"
            :class="{active:i === activeIndex}"
            @click="changeActiveIndex(i)">{{item}}</span>
      <span class="right-button playAll">
        <i class="iconfont icon-bofang"></i>
        播放全部</span>
      <span class="right-button collectAll">
        <i class="iconfont el-icon-folder-add"></i>
        收藏全部</span>
    </div>
    <router-view :type="type[activeIndex]"></router-view>
  </div>
</template>

<script>
export default {
  name:'Latestmusic',
  data(){
    return{
      isactive:true,
      activeIndex:0,
      tabs:['全部','华语','欧美','韩国','日本'],
      type:[0,7,96,16,8]
    }
  },
  methods:{
    changeActive(){
      this.isactive = !this.isactive
    },
    changeActiveIndex(index){
      this.activeIndex = index
    },
  }
}
</script>

<style scoped>
.outside{
  margin: 0 60px;
  position: relative;
}
.topbutton{
  margin: 0 auto;
  width: 230px;
  height: 28.5px;
  border-radius: 30px;
  border: .5px solid rgb(179,179,179);
  display: flex;
  justify-content: center;
}
.topbutton div{
  width: 50%;
  height: 28.5px;
  border-radius: 30px;
  font-size: 12px;
  text-align: center;
  line-height: 28.5px;
}
.button:hover {
  background-color: rgb(245,245,245);
  cursor: pointer;
}
.topbutton .active{
  background-color: rgb(187,187,187);
  color: #fff;
}
.tab{
  width: 290px;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  margin-top:30px;
  margin-bottom: 20px;
}
.tab span{
  color: rgb(103,103,103);
  font-weight: lighter;
  font-size: 14px;
}
.tab .active{
  font-weight: bold;
  color: #000;
  cursor: pointer;
}
.tab .right-button{
  border-radius: 30px;
  cursor: pointer;
  padding:3px 9px;
  font-size: 12.5px;
  font-weight: normal;
}
.tab .playAll{
  position: absolute;
  right: 128px;
  background-color: var(--netease-color);
  border: 1px solid var(--netease-color);
  color: #fff;
}
.tab .collectAll{
  position: absolute;
  right: 30px;
  color: #000;
  border: 1px solid rgb(216,216,216);
}
.playAll .icon-bofang{
  
  font-size: 12px;
  border-radius: 50%;
  border: 1px solid #fff;
}
.playAll .icon-bofang:before{
  display: inline-block;
  transform: scale(60%,60%);
}
.collectAll .el-icon-folder-add:before{
  color: rgb(139,139,139);
}

</style>